package com.wn.purchaeReturn.service.impl;


import com.wn.purchaeReturn.dao.PurPurchasereturnDao;
import com.wn.purchaeReturn.entity.PurPurchasereturn;
import com.wn.purchaeReturn.service.PurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Frank
 * @Date: 2022/4/18  15:12
 * @Description:
 */
@Service
@Transactional
public class PurchaseServiceimpl implements PurchaseService {
    @Autowired(required = false)
    private PurPurchasereturnDao purPurchasereturnDao;

    /**
     * 展示所有退货信息
     * @return
     */
    @Override
    public List<PurPurchasereturn> selAllPurcha() {
        return purPurchasereturnDao.selectByExample(null);
    }

    @Override
    public int insert(PurPurchasereturn record) {
        return purPurchasereturnDao.insert(record);
    }

    @Override
    public int updateByPrimaryKey(PurPurchasereturn record) {
        return purPurchasereturnDao.updateByPrimaryKey(record);
    }

    /**
     * 通过id进行查询
     * @param purchaseRtnNo
     * @return
     */
    @Override
    public PurPurchasereturn selById(Integer purchaseRtnNo) {
        return purPurchasereturnDao.selectByPrimaryKey(purchaseRtnNo);
    }
}
